<%--
    Document   : index
    Created on : Sep 17, 2013, 6:48:55 AM
    Author     : NamDH
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <link type="text/css" href="css/reg.css" rel="stylesheet">
        <link type="text/css" href="css/bootstrap.css" rel="stylesheet">
        <link type="text/css" href="css/index.css" rel="stylesheet">
        <script type="text/javascript" src="js/modernizr.min.js"></script>
        <script type="text/javascript" src="js/jquery-1.9.0.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.10.3.custom.min.js"></script>
        <script type="text/javascript" src="js/raphael-min.js"></script>
        <script type="text/javascript" src="js/underscore-min.js"></script>
        <script type="text/javascript" src="js/backbone-min.js"></script>
        <script type="text/javascript" src="js/bootstrap.min.js"></script>
        <script type="text/javascript" src="js/transition.js"></script>
        <script type="text/javascript" src="js/home.js"></script>


        <title>Login Page</title>
        <c:if test="${not empty sessionScope.ACCOUNT}">
            <c:redirect url="home.jsp"/>
        </c:if>
        <c:if test="${not empty sessionScope.GETPASSWORD}">
            <script type="text/javascript">
                $(function popuptracking() {
                    $("#dialog-modal").dialog({
                        minHeight: 200,
                        minWidth: 400,
                        modal: true,
                        title: "Forgot Password",
                        close: function(){
                            $("#main1").removeClass("ui-widget-overlay ui-front");
                        }
                    });

                    $("#main1").addClass("ui-widget-overlay ui-front");
                });


            </script>
        </c:if>
    </head>
    <body style="min-width: 360px">
        <div id="main1">
            <div id="fixed-header" class="navbar-fixed-top row">
                <div id="menu" class="row">
                    <div id="menu-inner">
                        <div id="messages"></div>
                        <div id="menu-left" class="col-5">
                            <div id="dd-left" class="col-1 text-left">
                                <a data-toggle="dropdown" style="margin-top:20px" class="btn btn-disabled dropdown-toggle"><i class="icon-menu"></i></a>
                                <ul aria-labelledby="dLabel" role="menu" class="dropdown-menu">
                                    <li><a href="home.jsp#features">How It Works</a></li>
                                    <li><a href="index.jsp">Search Products</a></li>
                                    <li><a href="FeedbackController?btAction=ShowFeedback">Feedback</a></li>
                                    <li><a href="register.jsp">Sign Up</a></li>
                                    <li>______________________</li>
                                    <li><a href="login.jsp">Login</a></li>
                                </ul>
                            </div>
                            <div class="col-2 hiw">
                                <a href="home.jsp">Home</a>
                            </div>
                        </div>
                        <div class="col-2 text-center">
                            <img src="Images/PRTS.png" style="height: 80px"/>
                        </div>
                        <div id="menu-right" class="col-5">
                            <div id="dd-right">
                                <a href="register.jsp">
                                    Sign Up
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div id="content-wrapper" style="margin-top: 70px;">
                <div id="login-holder" style="margin-top: 10px; ">
                    <br/>
                    <h3 style="color: red" align="center">${LOGINFAIL}${GETPASSSUCCESS}${GETPASSFAIL}${GETFAIL}${BANNEDUSER}</h3>
                    <h3 align="center">${REGISTERSUCCESS}</h3>
                    <div id="login-wrapper" class="col-12" style="text-align: center">
                        <div class="login-bg">
                            <form class="form-horizontal" id="login-form" method="post" action="LoginSignup">
                                <div class="form">
                                    <input type="text" placeholder="Email" name="email" maxlength="75" id="id_email" required>
                                    <input type="password" placeholder="Password" name="password" id="id_password" required>
                                </div>
                                <div id="lower-login" class="row">
                                    <div class="login-signup col-lg-6 col-md-4 col-sm-12 pull-left">
                                        <button name="action" type="submit" class="btn btn-primary btn-block" value="Login"
                                                onclick="var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
                                                    if (!filter.test(id_email.value)) {
                                                        alert('Invalid email address!! Example: toontran@yahoo.com....');
                                                        return false;
                                                    }
                                                ">Login</button>
                                    </div>
                                    <div class="login-signup col-lg-6 col-md-4 col-sm-12 pull-right">
                                        <a href="register.jsp" class="btn btn-primary btn-block">Sign Up</a>
                                    </div>
                                </div>


                            </form>

                            <div class="row">
                                <a id="forgotpw" href="LoginSignup?action=GetPassword">forgot password?</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div id="dialog-modal" class="row top-inner" style="display: none; min-height: 100px;">
                <c:if test="${not empty sessionScope.GETPASSWORD}">
                    <div class="login-bg">
                        <form class="form-horizontal" id="login-form" method="post" action="LoginSignup">
                            <div class="form">
                                <input type="text" placeholder="Email" name="txtGetEmail" maxlength="75" id="id_email" required>
                                <input type="text" placeholder="Full Name" name="txtGetUsername" required>
                            </div>
                            <div id="lower-login" class="row">
                                <div class="login-signup col-lg-6 col-md-4 col-sm-12 pull-left">
                                    <button name="action" type="submit" class="btn btn-primary btn-block" value="getPass"
                                            onclick="var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
                                                if (!filter.test(id_email.value)) {
                                                    alert('Invalid email address!! Example: toontran@yahoo.com....');
                                                    return false;
                                                }">Get</button>
                                </div>
                                <div class="login-signup col-lg-6 col-md-4 col-sm-12 pull-right">
                                    <button name="action" type="reset" class="btn btn-primary btn-block"
                                            >Clear</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </c:if>
            </div>
            <% session.removeAttribute("GETPASSWORD");%>


        </div>
    </body>
</html>
